<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta charset="UTF-8">
	<title>修改酒店房间</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

 <!-- 新模板 -->
<link rel="shortcut icon" href="<c:url value='/template/new_muban/images/favicon.ico'/>" type="image/x-icon"/>

<!-- 最新导入 -->
<script type="text/javascript" src="<c:url value='/template/new_muban/js/jquery-min-1.7.js'/>"></script>
<link rel="stylesheet" href="<c:url value='/template/new_muban/css/font.css'/>">
<link rel="stylesheet" href="<c:url value='/template/new_muban/css/xadmin.css'/>">   
<script src="<c:url value='/template/new_muban/lib/layui/layui.js'/>" charset="utf-8"></script> 
<script type="text/javascript" src="<c:url value='/template/new_muban/js/xadmin.js'/>"></script>

 <!-- 富文本编辑器 -->
<script type="text/javascript" charset="utf-8" src="<c:url value='/ue/ueditor.config.js'/>"></script>
<script type="text/javascript" charset="utf-8" src="<c:url value='/ue/ueditor.all.js'/>"> </script>

<style type="text/css">
	/*圆形头像  */
	/* #divcss5{ margin:10px auto}  */
	#divcss5 img{ border-radius:50%} 
	.x-so input.layui-input {
    	width: 150px;
	}
</style>
<style>
.layui-upload-img {
	width: 92px;
	height: 92px;
	margin: 0 10px 10px 0;
}
</style>
<style type="text/css">
.uploader-list {
	margin-left: -15px;
}

.uploader-list .info {
	position: relative;
	margin-top: -25px;
	background-color: black;
	color: white;
	filter: alpha(Opacity = 80);
	-moz-opacity: 0.5;
	opacity: 0.5;
	width: 100px;
	height: 25px;
	text-align: center;
	display: none;
}

.uploader-list .handle {
	position: relative;
	background-color: black;
	color: white;
	filter: alpha(Opacity = 80);
	-moz-opacity: 0.5;
	opacity: 0.5;
	width: 100px;
	text-align: right;
	height: 18px;
	margin-bottom: -18px;
	display: none;
}

.uploader-list .handle i {
	margin-right: 5px;
}

.uploader-list .handle i:hover {
	cursor: pointer;
}

.uploader-list .file-iteme {
	margin: 12px 0 0 15px;
	padding: 1px;
	float: left;
}

.input-50{
    width: 50%;
}
</style>
</head>
<body>
   
     <div class="x-body">
     
     
         <form class="layui-form"> 
 
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>房间号
              </label>
              <div class="layui-input-block">
                  <input type="text" id="hr_room" name="hr_room" value="${hotelRoomDetails.hr_room}"  placeholder="请输入房间号" maxlength="64" required="" lay-verify="required"
                  autocomplete="off" class="layui-input input-50">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>所属酒店
              </label>
              <div class="layui-input-block">
              	<c:forEach items="${allHotel}" var="ho" varStatus="index">
              		<input type="radio" name="hrn_id" value="${ho.hrn_id}" title="${ho.hrn_name}" <c:if test="${ho.hrn_id == hotelRoomDetails.hrn_id}">checked</c:if>>
              	</c:forEach>
                 	
              </div>
          </div>
            <%--  <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>酒店名称
              </label>
              <div class="layui-input-block">
                  <input type="text" id="hr_name" name="hr_name" value="${hotelRoomDetails.hr_name}" placeholder="请输入酒店名称" maxlength="64" required="" lay-verify="required"
                  autocomplete="off" class="layui-input input-50">
              </div>
          </div> --%>
           <%-- <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>性别
              </label>
              <div class="layui-input-block">
                 	<input type="radio" name="hr_sex" value="1" title="男"  <c:if test="${hotelRoomDetails.hr_sex == 1}">checked</c:if>>
                	<input type="radio" name="hr_sex" value="2" title="女"  <c:if test="${hotelRoomDetails.hr_sex == 2 }">checked</c:if>>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>类型
              </label>
              <div class="layui-input-block">
                 	<input type="radio" name="hr_type" value="1" title="学员"  <c:if test="${hotelRoomDetails.hr_type == 1 }">checked</c:if>>
                	<input type="radio" name="hr_type" value="2" title="销售"  <c:if test="${hotelRoomDetails.hr_type == 2 }">checked</c:if>>
              </div>
          </div> --%>
        
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  备注
              </label>
              <div class="layui-input-block">
                  <input type="text" id="hr_info" name="hr_info" ${hotelRoomDetails.hr_info}  placeholder="请输入备注" maxlength="64" 
                  autocomplete="off" class="layui-input input-50">
              </div>
          </div> 
          
      <%--   <div class="layui-form-item layui-form-text">
	    	<label class="layui-form-label"><span class="x-red">*</span>关联商铺</label>
	    	<div class="layui-input-block">
	    	<c:forEach items="${allShop}" var="shop" varStatus="index">
	   	 		 <input type="checkbox"  name="s_id" value="${shop.s_id}" title="${shop.s_name}" lay-skin="primary" >
              		<div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>${shop.s_name}</span><i class="layui-icon layui-icon-ok"></i></div>  
	    	</c:forEach>
	    	</div>
  		</div>
  		 <div class="layui-form-item layui-form-text">
	    	<label class="layui-form-label"><span class="x-red">*</span>关联门票</label>
	    	<div class="layui-input-block">
	    	<c:forEach items="${allTicket}" var="ticket" varStatus="index">
	   	 		 <input type="checkbox"  name="t_id" value="${ticket.t_id}" title="${ticket.t_name}" lay-skin="primary" >
              		<div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>${ticket.t_name}</span><i class="layui-icon layui-icon-ok"></i></div>  
	    	</c:forEach>
	    	</div>
  		</div>
           --%>
          
          
          
      <%--     <div class="layui-form-item layui-form-text">
	    	<label class="layui-form-label"><span class="x-red">*</span>文章板块</label>
	    	<div class="layui-input-block">
	    	<c:forEach items="${allModule}" var="modu" varStatus="index">
	    	<c:if test="${modu.fm_types == 1}">
	   	 		 <input type="checkbox"  name="fm_id" value="${modu.fm_id}" title="${modu.fm_name}" lay-skin="primary" >
              		<div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>${modu.fm_name}</span><i class="layui-icon layui-icon-ok"></i></div>  
	    	
	    	</c:if>
	    	</c:forEach>

	    	</div>
  		</div> --%>
  <!-- 		 <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>文章简介
              </label>
              <div class="layui-input-block">
                  <input type="text" id="a_desc" name="a_desc"  placeholder="请输入文章简介,最多128个文字" maxlength="128" required="" lay-verify="required"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
  		 -->
       
  <!--  <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>排序
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="a_sort" name="a_sort" value="0" placeholder="请输入排序值,数大在前" maxlength="4" required="" lay-verify="required"
                  autocomplete="off" class="layui-input"  onkeyup="this.value=this.value.replace(/\D/g,'');">
              </div>
          </div>  -->
          
      
    <!--   <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label"><span class="x-red">*</span>是否滚动</label>
	    <div class="layui-input-block">
	      <input type="radio" name="a_type" value="1" title="是">
	      <input type="radio" name="a_type" value="0" title="否" checked>
	    </div>
  	</div> -->
          
  <!-- 	<div class="layui-form-item layui-form-text">
			<label for="desc" class="layui-form-label"> <span
				class="x-red">*</span>首页小图
			</label>
			<div class="layui-input-inline">
			<input type="hidden" id="image1" lay-verify="required">
				<button type="button" class="layui-btn" id="image1_btn">上传图片</button>
				<div class="layui-upload-list">
					<img class="layui-upload-img" id="image1_demo" src="">
					<p id="image1_demoText"></p>
					<div class="layui-form-mid layui-word-aux">
                  		<span class="x-red">*</span>推荐尺寸 :<p id="fm_cc">600*450px</p>
              		</div>
				</div>
			</div>
		</div> -->
		<!-- <div class="layui-form-item layui-form-text">
			<label for="desc" class="layui-form-label"> <span
				class="x-red">*</span>顶部图
			</label>
			<div class="layui-input-inline">
			<input type="hidden" id="topimage" lay-verify="required">
				<button type="button" class="layui-btn" id="topimage_btn">上传图片</button>
				<div class="layui-upload-list">
					<img class="layui-upload-img" id="topimage_demo" src="">
					<p id="topimage_demoText"></p>
					<div class="layui-form-mid layui-word-aux">
                  		<span class="x-red">*</span>推荐尺寸 :<p id="fm_cc">600*450px</p>
              		</div>
				</div>
			</div>
		</div> -->
	
		
		
	
  <!-- 		<div class="layui-form-item layui-form-text">
              <label for="desc" class="layui-form-label">
          <span class="x-red">*</span>文章详情
              </label>
              <div class="layui-input-block" >
               	<script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
              </div>
           </div> -->
		
		</div>
	  
	  </div>
	</div> 
  
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="add" lay-submit="">
                 修改
              </button>
          </div>
      </form>
    </div>
    
    
  
    <script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });
        //执行一个laydate实例
        laydate.render({
      	  type: 'time'
      		    ,format: 'HH:mm:ss'
          ,elem: '#end_time' //指定元素
        });
        
        
        //执行一个laydate实例
  	  laydate.render({
  	    elem: '#hd_date' //指定元素  
  	   ,range: true
  	   ,type: 'datetime'
  	  });
  	  laydate.render({
    	    //指定元素
    	   	elem: '#hx_date'
    	   ,range: true
    	   ,type: 'datetime'
    	  });  
      });
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer;
          
          
          
        
          //自定义验证规则
          form.verify({
            nikename: function(value){
              if(value.length < 5){
                return '昵称至少得5个字符啊';
              }
            }
            ,pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,repass: function(value){
                if($('#L_pass').val()!=$('#L_repass').val()){
                    return '两次密码不一致';
                }
            }
          });

          var flag = "A";
          form.on('radio(ho_type)', function(data){
			    //console.log(data.elem); //得到radio原始DOM对象
			    console.log(data.value); //被点击的radio的value值
			     if(data.value==0){
			     	    flag = "B";
			     }
			   
			     
			}); 
          
          var ho_bx_flag = "A";
          form.on('radio(ho_bx)', function(data){
			    //console.log(data.elem); //得到radio原始DOM对象
			    console.log(data.value); //被点击的radio的value值
			     if(data.value==1){
			    	 ho_bx_flag = "B";
			     }
			   
			     
			}); 

          
          
          
          //监听提交
          form.on('submit(add)', function(data){
           
           //标题1
       var hr_id = "${hotelRoomDetails.hr_id}";
             var hr_room = $("#hr_room").val();
             

             
             if(hr_room == "" || hr_room == null){
	        	  layer.msg('请输入房间号!',{icon: 2,time:3000});      
		      	  return false; 
	         } 
           
          /*    var a_type = $("input:checkbox[name='fm_id']:checked").map(function(index,elem) {
	              return $(elem).val();
	          }).get().join(',');
			 if(a_type == null || a_type ==""){
				 layer.msg('请选择文章所属版块!',{icon: 2,time:3000});      
		      	  return false; 	 
			 } */
			   /*  var a_desc = $("#a_desc").val(); */
			 
           
           //副标题
           /*   var a_sort = $("#a_sort").val();
             if(a_sort == "" || a_sort == null){
            	 a_sort = 0;
	         }  */
           //滚动
           // var a_type = $('input[name="a_type"]:checked').val(); 
	       /*    var hr_sex = $('input[name="hr_sex"]:checked').val(); 
	         if(hr_sex == "" || hr_sex == null){
	        	  layer.msg('请选择性别!',{icon: 2,time:3000});      
		      	  return false; 
	         } 
	         var hr_type = $('input[name="hr_type"]:checked').val(); */
	         
	           var hr_info = $("#hr_info").val();
	          // var hr_name = $("#hr_name").val();
	             var hrn_id = $('input[name="hrn_id"]:checked').val();
	             if(hrn_id == "" || hrn_id == null){
	 	        	  layer.msg('请选择酒店!',{icon: 2,time:3000});      
	 		      	  return false; 
	 	         } 
           //首页小图
           //var a_wb_img = $("#image1").val();
          // var topimage = $("#topimage").val();
	
   			//详情
   /*          var a_content = UE.getEditor('editor').getContent();
	         if(a_content == "" || a_content == null){
	        	  layer.msg('请输入详情!',{icon: 2,time:3000});      
		      	  return false; 
	         }  */
	   /*       var s_id = $("input:checkbox[name='s_id']:checked").map(function(index,elem) {
	              return $(elem).val();
	          }).get().join(',');
	         
	         var t_id = $("input:checkbox[name='t_id']:checked").map(function(index,elem) {
	              return $(elem).val();
	          }).get().join(','); */
	    
        //	return false;
		 	   		//,"hr_name":hr_name				//"hr_sex":hr_sex,"hr_type":hr_type
        	  $.ajax({
	                type: 'POST',
	                url: "<c:url value='/updateHotelRoom.do'/>",
			     	async : false, // 注意此处需要yi步  
		    		data: {
		 	   			"hr_id":hr_id,"hr_room":hr_room,"hr_info":hr_info
		 	   		,"hrn_id":hrn_id
		    		},
			        success: function(data){		
						if (data == 0) {
		             	   layer.msg('修改失败!',{icon: 2,time:3000});      
		                    return false;
		                } else if(data ==1)  {
		
		                	  layer.msg("修改成功", {icon: 6,time:1000},function () {
		                          // 获得frame索引
		                          var index = parent.layer.getFrameIndex(window.name);
		                          //alert(index);
		                          //关闭当前frame
		                          parent.layer.close(index);
		                          //重新加载父页面
		                          parent.location.reload();
		                      });
				           }
	             
	                }
				});
        	
            return false;
          });
          
          
        });
    </script>
     <script type="text/javascript">
//小数验证
	function clearNoNum(obj){  
     //修复第一个字符是小数点 的情况.  
     if(obj.value !=''&& obj.value.substr(0,1) == '.'){  
         obj.value="";  
     }  
     obj.value = obj.value.replace(/^0*(0\.|[1-9])/, '$1');//解决 粘贴不生效  
     obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符  
     obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的       
     obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");      
     obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能输入两个小数       
     if(obj.value.indexOf(".")< 0 && obj.value !=""){//以上已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额  
         if(obj.value.substr(0,1) == '0' && obj.value.length == 2){  
             obj.value= obj.value.substr(1,obj.value.length);      
         }  
     }      
 }    
 </script>  
 
<script type="text/javascript">
//多图容器 【注册全局变量】
var images = [];

layui.use('upload', function(){
	  var $ = layui.jquery
	  ,upload = layui.upload;

	//多图片上传
	var uploadInst = upload.render({
		elem: '#test2'
            ,url: "<c:url value='/uploadToQiNiu.do'/>"
            ,multiple: true
            ,before: function(obj){
                layer.msg('图片上传中...', {
                    icon: 16,
                    shade: 0.01,
                    time: 0
                })
            }
            ,done: function(res){
            	//console.log(res);
            	//console.log(res.file_url);
                layer.close(layer.msg());//关闭上传提示窗口
                var title = res.file_url;
                var i1 = title.lastIndexOf("_"); //3
                title = title.substr(i1 +1);
                
                if ($(".file-iteme").length >=5) {
            		return layer.msg('上传图片不能多于5张！');
				  }else{
					  
	                //上传完毕
	                $('#uploader-list').append(
	                    '<div id="" class="file-iteme">' +
	                    '<div class="handle"><i class="layui-icon layui-icon-delete"></i></div>' +
	                    '<img style="width: 100px;height: 100px;" src='+ res.file_url +'>' +
	                    '<div class="info">' + title + '</div>' +
	                    '</div>'
	                    
	                );
	                  //追加图片成功追加文件名至图片容器
	                    images.push(res.file_url);
				 }
                
            }
	});
	
	
	
	
	
	
	/* 单图  */
	 upload.render({
		    elem: '#image1_btn'
	 	   ,url: '<%=request.getContextPath()%>/uploadToQiNiu.do'
	 	   ,auto:true
	 	,size: 2048//限制文件大小，单位 KB
	 	   ,exts: 'jpg|png|jpeg'
	 	   ,xhr:xhrOnProgress
	 	   ,progress:function(value){//上传进度回调 value进度值
	 	     console.log(value);
	 	     element.progress('demo', value+'%')//设置页面进度条
	 	    }
	 	   //,bindAction: '#test-upload-change-action'
	 	   ,before: function(obj){
	 	   //返回的参数item，即为当前的input DOM对象
	 	     layer.load(); //上传loading
	 	       console.log('文件上传中');
	 	 
	 	     //预读本地文件示例，不支持ie8
	 	     obj.preview(function(index, file, result){
	 	       $('#image1_demo').attr('src', result); //图片链接（base64）
	 	     });
	 	 
	 	   }
	 	   ,done: function(res){
	 	     console.log("返回码 : "+res.code);
	 		
	  		 //如果上传失败
	 	      if(res.code != 200){
	 	        return layer.msg('上传失败');
	 	      }
	 	     layer.closeAll();
	 	     layer.msg("上传成功");
	 	      //上传成功
	 	      $("#image1").val(res.file_url);
	 		
	 	   },error: function(){
		      //演示失败状态，并实现重传
		      var demoText = $('#image1_demoText');
		      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
		      demoText.find('.demo-reload').on('click', function(){
		        uploadInst.upload();
		      });
		    }

	});
	
	
	 /* 海报单图  */
	 upload.render({
		    elem: '#topimage_btn'
	 	   ,url: '<%=request.getContextPath()%>/uploadToQiNiu.do'
	 	   ,auto:true
	 	,size: 1024//限制文件大小，单位 KB
	 	   ,exts: 'jpg|png|jpeg'
	 	   ,xhr:xhrOnProgress
	 	   ,progress:function(value){//上传进度回调 value进度值
	 	     console.log(value);
	 	     element.progress('demo', value+'%')//设置页面进度条
	 	    }
	 	   //,bindAction: '#test-upload-change-action'
	 	   ,before: function(obj){
	 	   //返回的参数item，即为当前的input DOM对象
	 	     layer.load(); //上传loading
	 	       console.log('文件上传中');
	 	 
	 	     //预读本地文件示例，不支持ie8
	 	     obj.preview(function(index, file, result){
	 	       $('#topimage_demo').attr('src', result); //图片链接（base64）
	 	     });
	 	 
	 	   }
	 	   ,done: function(res){
	 	     console.log("返回码 : "+res.code);
	 		
	  		 //如果上传失败
	 	      if(res.code != 200){
	 	        return layer.msg('上传失败');
	 	      }
	 	     layer.closeAll();
	 	     layer.msg("上传成功");
	 	      //上传成功
	 	      $("#topimage").val(res.file_url);
	 		
	 	   },error: function(){
		      //演示失败状态，并实现重传
		      var demoText = $('#topimage_demoText');
		      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
		      demoText.find('.demo-reload').on('click', function(){
		        uploadInst.upload();
		      });
		    }

	});
	

	 /* 转发单图  */
	 upload.render({
		    elem: '#image3_btn'
	 	   ,url: '<%=request.getContextPath()%>/uploadToQiNiu.do'
	 	   ,auto:true
	 	,size: 1024//限制文件大小，单位 KB
	 	   ,exts: 'jpg|png|jpeg'
	 	   ,xhr:xhrOnProgress
	 	   ,progress:function(value){//上传进度回调 value进度值
	 	     console.log(value);
	 	     element.progress('demo', value+'%')//设置页面进度条
	 	    }
	 	   //,bindAction: '#test-upload-change-action'
	 	   ,before: function(obj){
	 	   //返回的参数item，即为当前的input DOM对象
	 	     layer.load(); //上传loading
	 	       console.log('文件上传中');
	 	 
	 	     //预读本地文件示例，不支持ie8
	 	     obj.preview(function(index, file, result){
	 	       $('#image3_demo').attr('src', result); //图片链接（base64）
	 	     });
	 	 
	 	   }
	 	   ,done: function(res){
	 	     console.log("返回码 : "+res.code);
	 		
	  		 //如果上传失败
	 	      if(res.code != 200){
	 	        return layer.msg('上传失败');
	 	      }
	 	     layer.closeAll();
	 	     layer.msg("上传成功");
	 	      //上传成功
	 	      $("#image3").val(res.file_url);
	 		
	 	   },error: function(){
		      //演示失败状态，并实现重传
		      var demoText = $('#image3_demoText');
		      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
		      demoText.find('.demo-reload').on('click', function(){
		        uploadInst.upload();
		      });
		    }

	});
	
	//音频
	 upload.render({
		    elem: '#test6'
		    ,url: '<%=request.getContextPath()%>/uploadToQiNiu.do'
		    ,accept: 'audio' //音频
		    ,done: function(res){
		      console.log(res)
		      $("#music").val(res.file_url);
		    }
		  });
	
});


$(document).on("mouseenter mouseleave", ".file-iteme", function(event){
    if(event.type === "mouseenter"){
        //鼠标悬浮
        $(this).children(".info").fadeIn("fast");
        $(this).children(".handle").fadeIn("fast");
    }else if(event.type === "mouseleave") {
        //鼠标离开
        $(this).children(".info").hide();
        $(this).children(".handle").hide();
    }
});

//删除图片
$(document).on("click", ".file-iteme .handle", function(event){
    
    var  $this = $(this).parent();   //  习惯性保存下当前标签
    var index = $this.index();
    console.info( index );
    
    
    $(this).parent().remove();
	  console.log(images);
  //获取下标
	//var subscript=$("#uploader-list img").index($(this));  
	//console.log("下标  :  "+subscript);
	//删除数组
	images.splice(index, 1);
	//重新排序
	//images.sort();
    console.log(images);
    
});


</script>   
<!-- 图片上传可视化用 -->
<script type="text/javascript">
//该部分代码主要使用ajax的xhr属性，我copy别人的，自己也不会写，应该不用管。

   var xhrOnProgress=function(fun) {
      xhrOnProgress.onprogress = fun; //绑定监听
       //使用闭包实现监听绑
      return function() {
          //通过$.ajaxSettings.xhr();获得XMLHttpRequest对象
          var xhr = $.ajaxSettings.xhr();
           //判断监听函数是否为函数
            if (typeof xhrOnProgress.onprogress !== 'function')
                 return xhr;
             //如果有监听函数并且xhr对象支持绑定时就把监听函数绑定上去
              if (xhrOnProgress.onprogress && xhr.upload) {
                    xhr.upload.onprogress = xhrOnProgress.onprogress;
              }
              return xhr;
       }
   };

// 图片弹出层
layui.use('layer', function(){
    $ = layui.jquery;//jquery
  layer = layui.layer;//弹出层

  //以上模块根据需要引入
	//轮播图弹出
    layer.ready(function(){ //为了layer.ext.js加载完毕再执行
      layer.photos({
        photos: '#x-img'
        //,shift: 5 //0-6的选择，指定弹出图片动画类型，默认随机
      });
    });

}); 
</script>  
<!-- ue初始化 -->
<script type="text/javascript">
	var ue = UE.getEditor('editor',{
		autoFloatEnabled:true,//浮动
		/*  toolbars: [[
    		'source','bold', 'italic',  'removeformat', 'formatmatch', 'autotypeset','selectall', 'cleardoc', 
           'lineheight', '|','fontfamily', 'fontsize', 'forecolor', 'backcolor','|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|','insertimage', 'emotion', 'insertvideo'
        ]]  */
	});
	
	/* var ue2 = UE.getEditor('editor_pz',{
		autoFloatEnabled:true,//浮动
		toolbars: [[
    		'source','bold', 'italic',  'removeformat', 'formatmatch', 'autotypeset','selectall', 'cleardoc', 
           'lineheight', '|','fontfamily', 'fontsize', 'forecolor', 'backcolor','|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|','insertimage', 'emotion', 
        ]]
	}); */
	
</script> 
			<!-- ue初始化 -->
<!-- <script type="text/javascript">
	var ue = UE.getEditor('editor1',{
		toolbars: [[
    		'source','bold', 'italic',  'removeformat', 'formatmatch', 'autotypeset','selectall', 'cleardoc', 
           'lineheight', '|','fontfamily', 'fontsize', 'forecolor', 'backcolor','|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|','insertimage', 'emotion', 'insertvideo'
        ]]
    });
</script>  -->  
<script type="text/javascript">
//检测是否为腾讯视频
function checkVideo() {
	/* alert("jinlaile "); */
	var videoReg = new RegExp('https://v.qq.com/x/((page)|(cover))/[a-zA-Z0-9_]+.html$');
	//视频
	var phone = $.trim($('#videourl').val());
	if (phone.length!=0) {
		
	
		if (!videoReg.test(phone)) {
			alert('您输入的网址有误吧，请输入腾讯视频上传网址！');
			$('#videourl').val("");
			return false;
			}
	}
	
	
}

</script>   
  </body>
</html>